home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / drdobbs / 1987 / 06 / bbs.l9 < prev    next >
Text File  |  1987-05-05  |  900b  |  55 lines

  1. Listing Nine
  2.  
  3. logs
  4.  
  5.  
  6.  
  7.     # create a temporary file with a log on record for each remote user
  8.  
  9. 1    who /etc/wtmp | grep ph >/u/user.log
  10.  
  11.     # if an "a" was entered as an argument to the command, display the entire log files
  12.  
  13. 2    if [ "$1" = a ]
  14. 3    then
  15. 4        echo
  16. 5        echo
  17. 6        echo "System Logins"
  18. 7        echo
  19.  
  20.     # display all system use since /etc/wtmp was last purged
  21.  
  22. 8        more /u/user.log
  23. 9        echo
  24. 10        echo "Next?"
  25. 11        read dummy
  26. 12        echo
  27.  
  28.     # display all BBS use since /u/bbs/log.file was last purged
  29.  
  30. 13        echo "BBS User Log"
  31. 14        echo
  32. 15        more /u/bbs/log.file
  33. 16        echo
  34.  
  35.     # otherwise, show only the last ten entries in each log file
  36.  
  37. 17    else
  38. 18        echo
  39. 19        echo
  40. 20        echo "Last System Logins"
  41. 21        echo
  42. 22        tail /u/user.log
  43. 23        echo
  44. 24        echo
  45. 25        echo "Last BBS Activity"
  46. 26        echo
  47. 27        tail /u/bbs/log.file
  48. 28        echo
  49. 29    fi
  50.  
  51.     # remove the temporary file
  52.  
  53. 29    rm /u/user.log
  54.  
  55.